home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / TRES.FRM < prev    next >
Text File  |  1997-06-14  |  4KB  |  162 lines

  1. VERSION 5.00
  2. Begin VB.Form FTestResources 
  3.    ClientHeight    =   4140
  4.    ClientLeft      =   1095
  5.    ClientTop       =   2070
  6.    ClientWidth     =   5355
  7.    Icon            =   "TRES.frx":0000
  8.    LinkTopic       =   "frmRes"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   4140
  11.    ScaleWidth      =   5355
  12.    Begin VB.CommandButton cmdExit 
  13.       Height          =   495
  14.       Left            =   3825
  15.       TabIndex        =   3
  16.       Top             =   720
  17.       Width           =   1215
  18.    End
  19.    Begin VB.CommandButton cmdSound 
  20.       Height          =   495
  21.       Left            =   3840
  22.       TabIndex        =   2
  23.       Top             =   120
  24.       Width           =   1215
  25.    End
  26.    Begin VB.TextBox txtDump 
  27.       BeginProperty Font 
  28.          Name            =   "Courier New"
  29.          Size            =   9
  30.          Charset         =   0
  31.          Weight          =   700
  32.          Underline       =   0   'False
  33.          Italic          =   0   'False
  34.          Strikethrough   =   0   'False
  35.       EndProperty
  36.       Height          =   2064
  37.       Left            =   180
  38.       Locked          =   -1  'True
  39.       MultiLine       =   -1  'True
  40.       TabIndex        =   1
  41.       Top             =   1944
  42.       Width           =   4965
  43.    End
  44.    Begin VB.ListBox lstStrings 
  45.       Height          =   840
  46.       Left            =   1320
  47.       TabIndex        =   0
  48.       Top             =   435
  49.       Width           =   2190
  50.    End
  51.    Begin VB.Label lblStrings 
  52.       Height          =   240
  53.       Left            =   1335
  54.       TabIndex        =   4
  55.       Top             =   45
  56.       Width           =   1185
  57.    End
  58.    Begin VB.Image imgMascot 
  59.       BorderStyle     =   1  'Fixed Single
  60.       Height          =   855
  61.       Left            =   300
  62.       Top             =   270
  63.       Width           =   885
  64.    End
  65.    Begin VB.Menu mnuFile 
  66.       Caption         =   ""
  67.       Begin VB.Menu mnuSound 
  68.          Caption         =   ""
  69.       End
  70.       Begin VB.Menu mnuExit 
  71.          Caption         =   ""
  72.       End
  73.    End
  74. End
  75. Attribute VB_Name = "FTestResources"
  76. Attribute VB_GlobalNameSpace = False
  77. Attribute VB_Creatable = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. Option Explicit
  81.  
  82. Enum ETestResource
  83.  
  84.     ordAppBmp = 101
  85.     ordAppMeta = 201
  86.     ordAppIcon = 301
  87.     ordAppCursor = 401
  88.     ordWavGrunt = 501
  89.     ordTxtData = 601
  90.     ordMetaTypewrite = 701
  91.     ordAviDrill = 801
  92.  
  93.     ordFrmTitle = 1001
  94.     ordMnuFile = 1101
  95.     ordMnuGrunt = 1102
  96.     ordMnuExit = 1103
  97.     ordLstTitle = 1201
  98.     ordLstWhat = 1301
  99.     ordLstWhy = 1302
  100.     ordLstWhere = 1303
  101.     ordLstWho = 1304
  102.     ordLstWhená = 1305
  103. End Enum
  104.  
  105. Private abWavGrunt() As Byte
  106. Private abDump() As Byte
  107. Private asText(1 To 5) As String
  108.  
  109. Private Sub Form_Load()
  110.  
  111.     App.Title = LoadResString(ordFrmTitle)
  112.     Me.Caption = LoadResString(ordFrmTitle)
  113.     Me.MousePointer = vbCustom
  114.     Me.MouseIcon = LoadResPicture(ordAppCursor, vbResCursor)
  115.     Me.Icon = LoadResPicture(ordAppIcon, vbResIcon)
  116.  
  117.     mnuFile.Caption = LoadResString(ordMnuFile)
  118.     mnuSound.Caption = LoadResString(ordMnuGrunt)
  119.     mnuExit.Caption = LoadResString(ordMnuExit)
  120.     cmdSound.Caption = LoadResString(ordMnuGrunt)
  121.     cmdExit.Caption = LoadResString(ordMnuExit)
  122.     
  123.     lblStrings.Caption = LoadResString(ordLstTitle)
  124.     Dim i As Integer
  125.     For i = 1 To 5
  126.         lstStrings.AddItem LoadResString(ordLstWhat + i - 1)
  127.     Next
  128.     
  129.     imgMascot.Picture = LoadResPicture(ordAppBmp, vbResBitmap)
  130.     
  131.     abDump = LoadResData(ordTxtData, "OURDATA")
  132.     
  133.     abWavGrunt = LoadResData(ordWavGrunt, "WAVE")
  134.     txtDump.Text = HexDump(abDump, False)
  135.  
  136. End Sub
  137.  
  138. Private Sub cmdExit_Click()
  139.     Unload Me
  140. End Sub
  141.  
  142. Private Sub Image1_Click()
  143.  
  144. End Sub
  145.  
  146. Private Sub mnuExit_Click()
  147.     Unload Me
  148. End Sub
  149.  
  150. Private Sub cmdSound_Click()
  151.     PlayWave abWavGrunt
  152. End Sub
  153.  
  154. Private Sub mnuSound_Click()
  155.     PlayWave abWavGrunt
  156. End Sub
  157.  
  158. Function PlayWave(ab() As Byte) As Boolean
  159.     PlayWave = sndPlaySoundAsBytes(ab(0), SND_MEMORY Or SND_SYNC)
  160. End Function
  161. '
  162.